<template>
	<div name="detailExperience">
		<van-nav-bar
			title="经验值明细"
			left-arrow
			left-text="返回"			
			fixed
			@click-left="$router.go(-1)"
		/>
		<van-cell-group title="">
            <h3 v-if="exprienceList.length===0">暂无经验值明细</h3>
            <div v-else >
                <div v-for="(c,index) in exprienceList" :key="index">
                    <van-cell   v-if="c.flag"  :title="c.time  + (c.limited?'限时签到':'一键签到')" :label="'经验值+' + c.experience" 
                      :value="c.distance!==undefined?c.distance+'m' :'补签'"/>
                </div>                  
            </div>           
        </van-cell-group>

        
	</div>
</template>

<script>
	// import { Dialog } from 'vant';
	// import bkDetails from '@/components/detailBk/bkDetails.vue';
	// import bkMember from '@/components/detailBk/bkMember.vue';
	// // import bkNotice from '@/components/detailBk/bkNotice.vue';
	// // import bkSource from '@/components/detailBk/bkSource.vue';
	// import {quitCourse} from '@/api/member.js';
	import { viewStudentSignInInfo ,viewSelfSignInInfo} from '@/api/signIn.js';
	export default {
		name: 'detailExperience',
		components: {		
			
		},
		created() {
			this.detailBankeInfo = JSON.parse(localStorage.getItem('detailBankeInfo'));
            this.detailMember = JSON.parse(localStorage.getItem('detailMember'));
            this.userInfo = JSON.parse(localStorage.getItem('userInfo'));

            if(this.userInfo.roles[0]==='TEACHER'){
                viewStudentSignInInfo(this.detailBankeInfo.id, this.detailMember.id).then(res=> {
                    console.log(res);
                    if(res.data.code === 0) {
                        this.exprienceList = res.data.data;
                    }
                })
            } else {
                viewSelfSignInInfo(this.detailBankeInfo.id).then(res=> {
                    console.log(res);
                    if(res.data.code === 0) {
                        this.exprienceList = res.data.data;
                    }
                })
            }
			
			
		},
		data(){
			return {
				exprienceList: []
			}
		},
		computed: {
			
			
		},
		methods: {
			
			
			
		}
	}
</script>

<style>
</style>
